<?php $this->beginClip('pagetitle'); ?>支付<?php $this->endClip(); ?>

<?php $this->renderPartial('/template/payLoading')?>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>


    easyloading('show');
    //业务逻辑
    $(document).ready(function(){
        setTimeout(function(){
            easyloading('hide');
            WeixinJSBridge.invoke('getBrandWCPayRequest', <?php echo $pay_info?>, function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok" ){

                    showMsg('支付成功',{position:'center'});
                    setTimeout(function(){
                        window.location.href = '<?php echo $callback_url?>';
                    }, 500);

                }else{
                    alert(res.err_msg);
                    for(var i in res){
                        alert(i + ': ' + res[i]);
                    }
                }
            });
        }, 1000);

    });
</script>